
const {ccclass, property} = cc._decorator;

@ccclass
export default class LoadUi extends cc.Component {
    @property(cc.Node)
    circle:cc.Node=null;
    _count=0;
    /**
     * loadui实例
     */
    public static instance:LoadUi = null;
    onLoad () {
        LoadUi.instance = this;
    };
    start () {
        this.circle.runAction(cc.repeatForever(cc.rotateBy(1,360)));
        if (this._count === 0) {                
            this.circle.pauseAllActions();
            this.node.x = -10000;
        }
    };
    retain () {
        if (this._count === 0) {            
            this.circle.resumeAllActions();
            this.node.x = 0;
        }
        this._count ++;
    };
    release () {
        this._count --;
        if (this._count === 0) { 
            this.circle.pauseAllActions();
            this.node.x = -10000;
        }
    };
}
